Scrape Crypto Prices with Selenium

Inspect crypto.com source code to obtain relevant XPaths

scrape-crypto-prices-1.png

Examine table element

scrape-crypto-prices-2.png

Extract XPath for <tr> element

scrape-crypto-prices-3.png

Extract XPath for <td> element

scrape-crypto-prices-4.png

Import libraries

Instantiate the WebDriver

Calculate the number of rows and columns in the table

Initialize empty lists for the desired data

Loop through the table and collect the data

Store data in pandas DataFrame

Quit the driver

Complete scraper